// components/GBTList/GBTList.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    dataList: {
      type: JSON,
      value: []
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    // 列表数据
    dataList: [
      {
      title: "111",
      mealDateTitle: "报餐日期",
      mealDateValue: "2019-09-13",
      mealTitle: "餐点",
      mealValue: "早餐",
      amount: 12,
      currency: "元",
    },
      {
        title: "111",
        mealDateTitle: "报餐日期",
        mealDateValue: "2019-09-13",
        mealTitle: "餐点",
        mealValue: "午餐",
        amount: 12,
        currency: "元",
      },
      {
        title: "111",
        mealDateTitle: "报餐日期",
        mealDateValue: "2019-09-13",
        mealTitle: "餐点",
        mealValue: "晚餐",
        amount: 12,
        currency: "元",
      }
    ],
  },

  /**
   * 组件的方法列表
   */
  methods: {
    //列表点击
    onItemClick: function(e) {
      console.log("点击了选项:" + e.currentTarget.dataset.index);
      let index = e.currentTarget.dataset.index;
      this.triggerEvent("itemclick", {
        index
      }, {});
    },
  }
})